<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org">

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">


    <title>仓库管理系统 - 登录</title>
    <meta name="keywords" content="H+后台主题,后台bootstrap框架,会员中心主题,后台HTML,响应式后台">
    <meta name="description" content="H+是一个完全响应式，基于Bootstrap3最新版本开发的扁平化主题，她采用了主流的左右两栏式布局，使用了Html5+CSS3等现代技术">

    <link rel="shortcut icon" href="favicon.ico">
    <link href="/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="/css/font-awesome.css?v=4.4.0" rel="stylesheet">

    <!-- Sweet Alert -->
    <link href="/css/plugins/sweetalert/sweetalert.css" rel="stylesheet">

    <link href="/css/animate.css" rel="stylesheet">
    <link href="/css/style.css?v=4.1.0" rel="stylesheet">


    <script th:src="@{/js/jquery-1.9.0.js}"></script>

    <!-- Sweet alert -->
    <script src="/js/plugins/sweetalert/sweetalert.min.js"></script>

    <!--[if lt IE 9]>
    <meta http-equiv="refresh" content="0;ie.html"/>
    <![endif]-->
    <script>if (window.top !== window.self) {
        window.top.location = window.location;
    }</script>
    <script type="text/javascript">
        $(function () {
            var url = "/login";
            $('#myform').submit(function () {
                $.post(url, $('#myform').serialize(), function (data) {
                    var jsonReturn = data;
                    if (jsonReturn.code == '0') {
                        swal({
                            title: jsonReturn.msg,
                            // text: "小手一抖就打开了一个框",
                            type: "success"
                        }, function () {
                            if (jsonReturn.role == '1')
                                location.href = "main";
                            else if(jsonReturn.role == '7'){
                                location.href = "/manage/index";
                            }else if(jsonReturn.role == '8'){
                                location.href = "/storeMange/index";
                            }
                            else
                                location.href = "/approval/index";

                        });
                    }
                    else {
                        swal({
                            title: "错误",
                            text: jsonReturn.msg
                        });
                    }
                });
                return false;
            });
        })


    </script>
</head>

<body class="gray-bg">

<div class="middle-box text-center loginscreen  animated fadeInDown">
    <div>
        <div>

            <h1 class="logo-name">医</h1>

        </div>
        <h3>欢迎使用 华信医院后台管理系统</h3>

        <form class="m-t" id="myform" role="form">
            <div class="form-group">
                <select name="identity" class="form-control">
                    <option th:each="role:${roleList}" th:value="${role.depId}" th:text="${role.zdec}"></option>
                </select>
            </div>
            <div class="form-group">
                <input type="email" name="username" class="form-control" placeholder="用户名" required="">
            </div>
            <div class="form-group">
                <input type="password" name="password" class="form-control" placeholder="密码" required="">
            </div>
            <button type="submit" class="btn btn-primary block full-width m-b">登 录</button>


            <p class="text-muted text-center"><a href="login.html#">
                <small>忘记密码了？</small>
            </a> | <a th:href="@{/reg}">注册一个新账号</a>
            </p>

        </form>
    </div>
</div>

<!-- 全局js -->
<script src="/js/jquery.min.js?v=2.1.4"></script>
<script src="/js/bootstrap.min.js?v=3.3.6"></script>

<!--<script type="text/javascript" src="http://tajs.qq.com/stats?sId=9051096" charset="UTF-8"></script>-->
<!--统计代码，可删除-->

</body>

</html>
